<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 300px;
            height: 300px;
            background: skyblue;
        }
        .inner{
            width: 100px;
            height: 100px;
            background: burlywood;
        }
    </style>
</head>
<body>
<div class="box">
    <div class="inner">

    </div>
</div>
    <script>
        //事件流三个阶段:
        // 1.冒泡阶段   2.目标节点     3捕获阶段
        // 冒泡从内往外
        // 捕获从外往内
        // 默认都是支持冒泡阶段
        // addEventListener默认也是支持冒泡,第三个参数也是支持冒泡,第三个参数默认为false
        oBox=document.querySelector(".box");
        oInner=document.querySelector(".inner");

        document.body.addEventListener("click",function(){
            console.log("body");
        })
        oBox.addEventListener("click",function(){
            console.log("box");
        })
        oInner.addEventListener("click",function(){
            console.log("inner");
        })
    </script>
</body>
</html>